package com.ruoyi.web.controller.video.controller;

import com.ruoyi.system.service.ResultNotifyReq;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

/**
 * @Author hongwei
 * @Date 2021/3/22 9:25
 */
public class WebServicePublish {
    public static void main(String[] args) {
      /*  String address="http://localhost:8089/WS_Server/WebService";
        Endpoint.publish(address, new WebServiceImpl());
        System.out.println("发布webservice成功");*/

        try {
            // 接口地址
            String address = "http://localhost:9001/fqz/services/ResultNotifyReq?wsdl";
            // 代理工厂
            JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
            // 设置代理地址
            jaxWsProxyFactoryBean.setAddress(address);
            // 设置接口类型
            jaxWsProxyFactoryBean.setServiceClass(ResultNotifyReq.class);
            // 创建一个代理接口实现
            ResultNotifyReq cs = (ResultNotifyReq) jaxWsProxyFactoryBean.create();
            // 调用代理接口的方法调用并返回结果
            //System.out.println("返回结果:" + cs.saveResults("1", "1", "1", "1", "1"));
            //System.out.println(cs.hello("uu"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
